package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sc.nft.entity.SpecialEventManagementBinding;
import com.sc.nft.entity.vo.OriginalCopyrightCollectionVO;
import com.sc.nft.entity.vo.SpecialEventManagementBindingVO;
import com.sc.nft.mapper.SpecialEventManagementBindingMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 专场管理(SpecialEventManagementBinding)表Dao层
 *
 * @author 王伟成
 * @since 2023-10-10 15:25:10
 */
@Slf4j
@Repository
public class SpecialEventManagementBindingDao extends ServiceImpl<SpecialEventManagementBindingMapper, SpecialEventManagementBinding> {


    public Boolean isBinding(Long collectionId) {
        LambdaQueryWrapper<SpecialEventManagementBinding> lambdaQueryWrapper = Wrappers.lambdaQuery();
        lambdaQueryWrapper.eq(SpecialEventManagementBinding::getCollectionId,collectionId);
        return count(lambdaQueryWrapper)>0;
    }
    public List<OriginalCopyrightCollectionVO> listRelevanceCollection(Long eventManagementId) {
        return baseMapper.listRelevanceCollection(eventManagementId);
    }
    public List<SpecialEventManagementBindingVO> listLeftJoinDig(Long eventManagementId) {
        return baseMapper.listleftjoinDig(eventManagementId);
    }
}
